Import('BuildUtil env')

target = 'makensisw'

files = Split("""
	makensisw.cpp
	noclib.cpp
	toolbar.cpp
	utils.cpp
	version.cpp
	update.cpp
	jnetlib/asyncdns.cpp
	jnetlib/connection.cpp
	jnetlib/httpget.cpp
	jnetlib/util.cpp
""")

resources = Split("""
	shell.ico
	icon.ico
	makensisw.xml
	logo.bmp
	toolbar.bmp
	toolbar24.bmp
	toolbar24d.bmp
	toolbar24h.bmp
""")

libs = Split("""
	kernel32
	advapi32
	user32
	gdi32
	shell32
	comdlg32
	comctl32
	wsock32
""")

docs = Split("""
	License.txt
	Readme.txt
""")

if env['UNICODE']:
	BuildUtil(
		target,
		files,
		libs,
		res = ['uresource.rc'],
		resources = resources,
		entry = 'wWinMain',
		defines = ['RELEASE=2.3', '_UNICODE', 'UNICODE'],
		docs = docs,
		root_util = True
	)
else:
	BuildUtil(
		target,
		files,
		libs,
		res = ['resource.rc'],
		resources = resources,
		entry = 'WinMain',
		defines = ['RELEASE=2.3'],
		docs = docs,
		root_util = True
	)
